import {createRouter,createWebHashHistory} from 'vue-router';
const routes = [
    {
        path:'/',
        redirect:'/newcar'
    },
    {
        path:'/newcar',
        name:'newcar',
        component:()=>import('@/views/Newcar.vue'),
        redirect:'/newcar/newnengyuan',
        children:[
            {
                path:'newche',
                name:'newche',
                component:()=>import('@/views/NewCar/Newcar.vue')
            },
            {
                path:'newnengyuan',
                name:'newnengyuan',
                component:()=>import('@/views/NewCar/Newenergy.vue'),
                redirect:'/newcar/newnengyuan/popularbrands',
                children:[
                    {
                        path:'popularbrands',
                        name:'hotbrands',
                        component:()=>import('@/views/NewCar/Newenergy/HotBrands.vue')
                    },
                    {
                        path:'brandselection',
                        name:'brandselection',
                        component:()=>import('@/views/NewCar/Newenergy/BrandSelection.vue')
                    },
                    {
                        path:'conditionselection',
                        name:'conditionselection',
                        component:()=>import('@/views/NewCar/Newenergy/ConditionSelection.vue')
                    }
                ]
            },
            {
                path:'brand',
                name:'brand',
                component:()=>import('@/views/NewCar/Brand.vue')
            }
        ]
    },
    {
        path:'/newenergy',
        name:'newenergy',
        component:()=>import('@/views/NewEnergy.vue')
    },
    {
        path:'/find',
        name:'find',
        component:()=>import('@/views/Find.vue')
    },
    {
        path:'/usedcar',
        name:'usedcar',
        component:()=>import('@/views/Used_car.vue')
    },
    {
        path:'/myself',
        name:'myself',
        component:()=>import('@/views/Myself.vue')
    }
]
const router = createRouter({
    history:createWebHashHistory(),
    routes
})
export default router;